<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<!-- modify by zhangwei -->
<!-- 百度站长 -->
<meta name="baidu-site-verification" content="MdPKZBgY0U">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="8DKRuNxJDPU2k6cNyVhLe_eSqGk-R8oiYk8iKMg5gwI">














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="mask-icon" href="/uploads/favicon.ico?v=5.1.4" color="#222">





  <meta name="keywords" content="Android,AndroidStudio,gradle,">





  <link rel="alternate" href="/atom.xml" title="班德尔城" type="application/atom+xml">






<meta name="description" content="Gradle是一个基于JVM的构建工具，是一款通用灵活的构建工具，支持maven， Ivy仓库，支持传递性依赖管理，而不需要远程仓库或者是pom.xml和ivy.xml配置文件，基于Groovy，build脚本使用Groovy编写。AndroidStudio在使用过程中常见的Gradle问题">
<meta name="keywords" content="Android,AndroidStudio,gradle">
<meta property="og:type" content="article">
<meta property="og:title" content="专治AndroidStudio中Gradle疑难杂症">
<meta property="og:url" content="https://tiimor.cn/专治AndroidStudio中Gradle的疑难杂症/index.html">
<meta property="og:site_name" content="班德尔城">
<meta property="og:description" content="Gradle是一个基于JVM的构建工具，是一款通用灵活的构建工具，支持maven， Ivy仓库，支持传递性依赖管理，而不需要远程仓库或者是pom.xml和ivy.xml配置文件，基于Groovy，build脚本使用Groovy编写。AndroidStudio在使用过程中常见的Gradle问题">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Gradle.jpg">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E9%87%8D%E5%A4%8D%E4%BE%9D%E8%B5%96.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/AndroidStudio%E8%BF%90%E8%A1%8C%E5%86%85%E5%AD%98%E6%BA%A2%E5%87%BA.png">
<meta property="og:updated_time" content="2019-03-17T06:47:42.386Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="专治AndroidStudio中Gradle疑难杂症">
<meta name="twitter:description" content="Gradle是一个基于JVM的构建工具，是一款通用灵活的构建工具，支持maven， Ivy仓库，支持传递性依赖管理，而不需要远程仓库或者是pom.xml和ivy.xml配置文件，基于Groovy，build脚本使用Groovy编写。AndroidStudio在使用过程中常见的Gradle问题">
<meta name="twitter:image" content="http://cdn.tiimor.cn/images/Gradle.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '3AUIZWGETM',
      apiKey: '5fcd6d51d892fffe3480c5b37f5fd4fa',
      indexName: 'Tiimor',
      hits: {"per_page":8},
      labels: {"input_placeholder":"搜索","hits_empty":"未发现与「${query}」相关的内容","hits_stats":"${hits} 条相关条目，使用了 ${time} 毫秒"}
    }
  };
</script>



  <link rel="canonical" href="https://tiimor.cn/专治AndroidStudio中Gradle的疑难杂症/">





  <title>专治AndroidStudio中Gradle疑难杂症 | 班德尔城</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-96457043-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?abb97f8f68c9e5eb2217d3111c64e696";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

  <!-- modify by zhangwei -->
  <!-- 下雪的动画 -->
  <div class="canvas-snow">
    <canvas id="canvas" style="margin: 0;  padding: 0;top:0; left: 0; right: 0; background: transparent; position: absolute;" width="1366" height="105"></canvas>
      <script>

      var canvasBgImg = {
        start: function () {
          this.canvas = document.getElementById('canvas')
          this.ctx = this.canvas.getContext("2d")
          this.canvas.width = window.innerWidth
          this.canvas.height = 105
          this.starList = []
        },
        drawLine: function (ctx, x1, y1, x2, y2) {
          ctx.beginPath()
          ctx.strokeStyle = '#ffffff'
          ctx.lineTo(x1, y1)
          ctx.lineTo(x2, y2)
          ctx.stroke()
        },
        canvasSingleSnow: function (snowSize) {
          var singleSnow = document.createElement('canvas'),
            ctxSingle = singleSnow.getContext('2d')
          singleSnow.setAttribute('width', snowSize * 2)
          singleSnow.setAttribute('height', snowSize * 2)
          for (var i = 0; i < 6; i++) {
            ctxSingle.save()
            ctxSingle.translate(snowSize, snowSize)
            ctxSingle.rotate(Math.PI * 2 * i / 6)
            this.drawLine(ctxSingle, 0, 0, snowSize, 0)
            ctxSingle.restore()
          }
          return singleSnow
        },
        canvasAllSnow: function (centerSnow) {
          var canvasSnow = document.createElement('canvas'),
            ctxSnow = canvasSnow.getContext('2d'),
            bigSnow = this.canvasSingleSnow(centerSnow),
            smallSnow = this.canvasSingleSnow(centerSnow / 3),
            sizeSnow = centerSnow * 3 / 5,
            rSnow = centerSnow - sizeSnow / 2
          canvasSnow.setAttribute('width', centerSnow * 2)
          canvasSnow.setAttribute('height', centerSnow * 2)
          ctxSnow.drawImage(bigSnow, 0, 0, bigSnow.width, bigSnow.height, 0, 0, centerSnow * 2, centerSnow * 2)
          for (var i = 0; i < 6; i++) {
            ctxSnow.save()
            ctxSnow.translate(centerSnow, centerSnow)
            ctxSnow.rotate(Math.PI * 2 * i / 6)
            ctxSnow.drawImage(smallSnow, 0, 0, smallSnow.width, smallSnow.height, rSnow - sizeSnow / 2,
              -sizeSnow / 2, sizeSnow, sizeSnow)
            ctxSnow.restore()
          }
          return canvasSnow
        },
        init: function () {
          this.start()
          for (var i = 0; i < 75; i++) {
            this.starList.push({
              drawFunc: this.canvasAllSnow(15),
              width: Math.random() * this.canvas.width,
              height: Math.random() * this.canvas.height,
              speed: Math.random() * 1.5 + .5,
              scale: Math.random() * 12 + 5,
              angel: 0
            })
          }
          var self = this,
            loop = function () {
              self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.width)
              for (var i = 0; i < 75; i++) {
                self.ctx.save()
                self.starList[i].height = self.starList[i].height + self.starList[i].speed
                self.starList[i].angel += 2
                self.ctx.translate(self.starList[i].width, self.starList[i].height)
                self.ctx.rotate(self.starList[i].angel * Math.PI / 360)
                self.ctx.translate(-self.starList[i].width, -self.starList[i].height)
                self.ctx.drawImage(self.starList[i].drawFunc, 0, 0,
                  self.starList[i].drawFunc.width, self.starList[i].drawFunc.height,
                  self.starList[i].width - self.starList[i].scale / 2,
                  self.starList[i].height - self.starList[i].scale / 2,
                  self.starList[i].scale, self.starList[i].scale)
                if (self.starList[i].height > self.canvas.height) {
                  self.starList[i] = Object.assign(self.starList[i], {
                    height: -self.starList[i].scale,
                    width: Math.random() * this.canvas.width
                  })
                }
                self.ctx.restore()
              }
              requestAnimationFrame(loop)
            }
          requestAnimationFrame(loop)
        }
      }
      canvasBgImg.init()
      </script>

    </div>


    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <!-- modify by zhangwei -->
        <!-- 圣诞帽 -->
        <img src="/uploads/santa-hat.png" id="santa" style="height: 41px; position: absolute; left: -40px; top: -20px; transform: rotate(-45deg); z-index: 9000;">

        <span class="logo-line-before"><i></i></span>
        <span class="site-title">班德尔城</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">微笑，简单，奋发</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-guestbook">
          <a href="/guestbook" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-send"></i> <br>
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-favourite">
          <a href="/favourite" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-bookmark"></i> <br>
            
            收藏
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tiimor.cn/专治AndroidStudio中Gradle的疑难杂症/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Tiimor">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="班德尔城">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">专治AndroidStudio中Gradle疑难杂症</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-03-31T20:48:05+08:00">
                2017-03-31
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/攻城狮/" itemprop="url" rel="index">
                    <span itemprop="name">攻城狮</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/专治AndroidStudio中Gradle的疑难杂症/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count gitment-comments-count" data-xid="/专治AndroidStudio中Gradle的疑难杂症/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/专治AndroidStudio中Gradle的疑难杂症/" class="leancloud_visitors" data-flag-title="专治AndroidStudio中Gradle疑难杂症">
               <span class="post-meta-divider">|</span>
               <!-- modify by zhangwei -->
               <!-- 去掉阅读的眼睛图标，阅读次数改为℃ -->
			   
                 <span class="post-meta-item-text">热度 </span>
               
                 <span class="leancloud-visitors-count"></span>
				 <span>℃</span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="http://cdn.tiimor.cn/images/Gradle.jpg" alt="gradle"><br>Gradle&#x662F;&#x4E00;&#x4E2A;&#x57FA;&#x4E8E;JVM&#x7684;&#x6784;&#x5EFA;&#x5DE5;&#x5177;&#xFF0C;&#x662F;&#x4E00;&#x6B3E;&#x901A;&#x7528;&#x7075;&#x6D3B;&#x7684;&#x6784;&#x5EFA;&#x5DE5;&#x5177;&#xFF0C;&#x652F;&#x6301;maven&#xFF0C; Ivy&#x4ED3;&#x5E93;&#xFF0C;&#x652F;&#x6301;&#x4F20;&#x9012;&#x6027;&#x4F9D;&#x8D56;&#x7BA1;&#x7406;&#xFF0C;&#x800C;&#x4E0D;&#x9700;&#x8981;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#x6216;&#x8005;&#x662F;pom.xml&#x548C;ivy.xml&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x57FA;&#x4E8E;Groovy&#xFF0C;build&#x811A;&#x672C;&#x4F7F;&#x7528;Groovy&#x7F16;&#x5199;&#x3002;<strong>AndroidStudio&#x5728;&#x4F7F;&#x7528;&#x8FC7;&#x7A0B;&#x4E2D;&#x5E38;&#x89C1;&#x7684;Gradle&#x95EE;&#x9898;</strong></p>
<a id="more"></a>
<h1 id="&#x65B9;&#x6CD5;&#x6570;&#x8D85;&#x8FC7;64K"><a href="#&#x65B9;&#x6CD5;&#x6570;&#x8D85;&#x8FC7;64K" class="headerlink" title="&#x65B9;&#x6CD5;&#x6570;&#x8D85;&#x8FC7;64K"></a>&#x65B9;&#x6CD5;&#x6570;&#x8D85;&#x8FC7;64K</h1><blockquote>
<p>&#x5DE5;&#x7A0B;&#x4E2D;&#xFF0C;&#x5305;&#x62EC;&#x5F15;&#x7528;&#x7684;library&#x7684;&#x65B9;&#x6CD5;&#x6570;&#x8D85;&#x8FC7;65536(64K)&#x65F6;&#x51FA;&#x73B0;</p>
</blockquote>
<ul>
<li>&#x5220;&#x9664;&#x4E0D;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5220;&#x9664;&#x4E0D;&#x4F7F;&#x7528;&#x7684;jar&#xFF1B;<code>compile fileTree(dir: &apos;libs&apos;, include: [&apos;*.jar&apos;])</code>&#xFF0C;&#x4F1A;&#x7F16;&#x8BD1;libs&#x4E0B;&#x6240;&#x6709;&#x7684;jar&#xFF0C;&#x4F7F;&#x7528;<code>compile files()</code>&#x4F9D;&#x6B21;&#x6DFB;&#x52A0;&#x9700;&#x8981;&#x7684;&#x4F9D;&#x8D56;</li>
<li>&#x5206;&#x5305;&#xFF0C;&#x914D;&#x7F6E;build.gradle&#x6587;&#x4EF6;&#xFF0C;&#x901A;&#x8FC7;&#x5728;defaultConfig&#x4E2D;&#x8BBE;&#x7F6E;multiDexEnabled&#x53EF;&#x4EE5;&#x5F00;&#x542F;&#x5206;&#x5305;&#x6A21;&#x5F0F;&#xFF0C;&#x5206;&#x5305;&#x4E4B;&#x540E;&#x7684;Dex&#x5C31;&#x4F4E;&#x4E8E;&#x4E86;&#x9650;&#x5236;&#x6570;&#xFF0C;&#x4FDD;&#x8BC1;&#x4E86;&#x6B63;&#x5E38;&#x7684;&#x6253;&#x5305;<figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">android</span> {</span><br><span class="line">	<span class="section">defaultConfig</span> {</span><br><span class="line">		<span class="attribute">multiDexEnabled</span> <span class="literal">true</span></span><br><span class="line">	}</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<h1 id="&#x5305;&#x51B2;&#x7A81;"><a href="#&#x5305;&#x51B2;&#x7A81;" class="headerlink" title="&#x5305;&#x51B2;&#x7A81;"></a>&#x5305;&#x51B2;&#x7A81;</h1><blockquote>
<p>1.Android Studio&#x9047;&#x5230;transformClassesWithDexForDebug&#x9519;&#x8BEF;<br>2.Android Studio com.android.dex.DexException: Multiple dex files define(&#x91CD;&#x590D;&#x5F15;&#x7528;&#x5305;)</p>
</blockquote>
<ul>
<li>&#x53BB;&#x6389;&#x76F8;&#x540C;&#x7684;&#x4F9D;&#x8D56;&#x5305;</li>
<li>&#x5C06;<code>compile files()</code>&#x66FF;&#x6362;&#x4E3A;<code>provided files()</code></li>
<li>&#x4F7F;&#x7528;&#x5982;&#x4E0B;&#x65B9;&#x5F0F;&#xFF0C;&#x9632;&#x6B62;v4&#x7B49;&#x5305;&#x51B2;&#x7A81;<figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">compile</span>(xxx) {</span><br><span class="line">	<span class="keyword">exclude</span> <span class="keyword">group</span>: <span class="string">&quot;com.android.support&quot;</span>, module: <span class="string">&quot;support-v4&quot;</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<h1 id="&#x91CD;&#x590D;&#x4F9D;&#x8D56;"><a href="#&#x91CD;&#x590D;&#x4F9D;&#x8D56;" class="headerlink" title="&#x91CD;&#x590D;&#x4F9D;&#x8D56;"></a>&#x91CD;&#x590D;&#x4F9D;&#x8D56;</h1><blockquote>
<p>&#x5F15;&#x7528;&#x4F9D;&#x8D56;&#x65F6;&#xFF0C;&#x51FA;&#x73B0;&#x6587;&#x4EF6;&#x91CD;&#x590D;&#xFF1A;&#x5982;&#x5F15;&#x7528;RxJavaAdapter&#x548C;RxJava</p>
</blockquote>
<ul>
<li><p>&#x53BB;&#x6389;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#xFF0C;&#x53BB;&#x6389;rxjava:2.0.8</p>
<figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">compile</span> <span class="string">&apos;com.squareup.retrofit2:adapter-rxjava:2.2.0&apos;</span></span><br><span class="line"><span class="keyword">compile</span> <span class="string">&apos;io.reactivex.rxjava2:rxjava:2.0.8&apos;</span></span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x66F4;&#x6362;&#x4E3A;&#x517C;&#x5BB9;&#x7684;&#x4F9D;&#x8D56;&#x5E93;&#x7248;&#x672C;<br>&#x4FEE;&#x6539;rxjava2&#x4E3A;rxjava&#xFF0C;&#x5982;<code>compile &apos;io.reactivex:rxjava:1.2.2&apos;</code><br><img src="http://cdn.tiimor.cn/images/%E9%87%8D%E5%A4%8D%E4%BE%9D%E8%B5%96.png" alt="&#x91CD;&#x590D;&#x4F9D;&#x8D56;"></p>
</li>
</ul>
<h1 id="&#x4F9D;&#x8D56;so&#x5F02;&#x5E38;"><a href="#&#x4F9D;&#x8D56;so&#x5F02;&#x5E38;" class="headerlink" title="&#x4F9D;&#x8D56;so&#x5F02;&#x5E38;"></a>&#x4F9D;&#x8D56;so&#x5F02;&#x5E38;</h1><figure class="highlight sql"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java.lang.UnsatisfiedLinkError: Couldn&apos;t <span class="keyword">load</span> ktvDb_jni <span class="keyword">from</span> loader dalvik.system.PathClassLoader[DexPathList[[zip <span class="keyword">file</span> <span class="string">&quot;/data/app/com.example.test-2.apk&quot;</span>],nativeLibraryDirectories=[/<span class="keyword">data</span>/app-lib/com.example.test<span class="number">-2</span>, /<span class="keyword">system</span>/lib]]]: findLibrary returned <span class="literal">null</span></span><br></pre></td></tr></tbody></table></figure>
<ul>
<li>&#x5728;build.gradle&#x6587;&#x4EF6;&#x91CC;&#x6DFB;&#x52A0;&#x4F9D;&#x8D56;&#x7684;.so&#x5E93;<figure class="highlight puppet"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">android</span> {</span><br><span class="line">	sourceSets {</span><br><span class="line">		<span class="keyword">main</span> {</span><br><span class="line">			jniLibs.srcDirs = [<span class="string">&apos;libs&apos;</span>]</span><br><span class="line">		}</span><br><span class="line">	}</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<h1 id="&#x4E2D;&#x6587;&#x4E71;&#x7801;"><a href="#&#x4E2D;&#x6587;&#x4E71;&#x7801;" class="headerlink" title="&#x4E2D;&#x6587;&#x4E71;&#x7801;"></a>&#x4E2D;&#x6587;&#x4E71;&#x7801;</h1><ul>
<li><p>Android&#x8BBE;&#x5907;&#x4E0A;&#x8FD0;&#x884C;&#x663E;&#x793A;&#x4E2D;&#x6587;&#x4E71;&#x7801;</p>
<figure class="highlight stylus"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">android {</span><br><span class="line">	compileOptions<span class="selector-class">.encoding</span> = <span class="string">&quot;GBK&quot;</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x7F16;&#x7801; UTF-8 &#x7684;&#x4E0D;&#x53EF;&#x6620;&#x5C04;&#x5B57;&#x7B26;<br>gradle2.0+&#x662F;JavaCompile&#xFF0C;&#x5426;&#x5219;&#x662F;Compile</p>
  <figure class="highlight stylus"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">tasks.withType(JavaCompile) {</span><br><span class="line">    options<span class="selector-class">.encoding</span> = <span class="string">&quot;UTF-8&quot;</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
  <figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">tasks.withType(<span class="keyword">Compile</span>) {</span><br><span class="line">    <span class="keyword">options</span>.encoding = <span class="string">&quot;UTF-8&quot;</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x63A7;&#x5236;&#x53F0;Logcat&#x6253;&#x5370;&#x4E71;&#x7801;<br>File-&gt;Settings-&gt;Editor-&gt;File Encodings-&gt;&#x4FEE;&#x6539;&#x9879;&#x76EE;&#x7F16;&#x7801;&#x4E3A;GBK</p>
</li>
</ul>
<h1 id="&#x627E;&#x4E0D;&#x5230;HttpClient&#x65B9;&#x6CD5;"><a href="#&#x627E;&#x4E0D;&#x5230;HttpClient&#x65B9;&#x6CD5;" class="headerlink" title="&#x627E;&#x4E0D;&#x5230;HttpClient&#x65B9;&#x6CD5;"></a>&#x627E;&#x4E0D;&#x5230;HttpClient&#x65B9;&#x6CD5;</h1><blockquote>
<p>Android Studio &#x4F7F;&#x7528;ApachHttp&#x4F20;&#x8F93;&#x4E0B;&#x8F7D;&#x65F6;&#xFF0C;&#x627E;&#x4E0D;&#x5230;HttpClient</p>
</blockquote>
<ul>
<li>&#x5728;build.gradle&#x91CC;&#x9762;&#x6DFB;&#x52A0;<figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">useLibrary</span> <span class="string">&apos;org.apache.http.legacy&apos;</span></span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<h1 id="Gradle&#x7F16;&#x8BD1;&#x7981;&#x7528;Lint&#x62A5;&#x9519;"><a href="#Gradle&#x7F16;&#x8BD1;&#x7981;&#x7528;Lint&#x62A5;&#x9519;" class="headerlink" title="Gradle&#x7F16;&#x8BD1;&#x7981;&#x7528;Lint&#x62A5;&#x9519;"></a>Gradle&#x7F16;&#x8BD1;&#x7981;&#x7528;Lint&#x62A5;&#x9519;</h1><ul>
<li>&#x5728;build.gradle&#x91CC;&#x6DFB;&#x52A0;<figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">android</span> {</span><br><span class="line">	<span class="section">lintOptions</span> {</span><br><span class="line">	    <span class="attribute">checkReleaseBuilds</span> <span class="literal">false</span></span><br><span class="line">	    abortOnError <span class="literal">false</span></span><br><span class="line">	}</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<h1 id="&#x8FD0;&#x884C;&#x5185;&#x5B58;&#x6EA2;&#x51FA;"><a href="#&#x8FD0;&#x884C;&#x5185;&#x5B58;&#x6EA2;&#x51FA;" class="headerlink" title="&#x8FD0;&#x884C;&#x5185;&#x5B58;&#x6EA2;&#x51FA;"></a>&#x8FD0;&#x884C;&#x5185;&#x5B58;&#x6EA2;&#x51FA;</h1><blockquote>
<p>AndroidStudio&#x8FD0;&#x884C;APK&#x65F6;&#xFF0C;&#x51FA;&#x73B0;java.lang.OutOfMemoryError&#xFF1A;GC overhead limit exceeded</p>
</blockquote>
<ul>
<li><p>&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;</p>
  <figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">android</span> {</span><br><span class="line">	<span class="section">dexOptions</span> {</span><br><span class="line">    	<span class="attribute">javaMaxHeapSize</span> <span class="string">&quot;4g&quot;</span></span><br><span class="line">    }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<p>  <img src="http://cdn.tiimor.cn/images/AndroidStudio%E8%BF%90%E8%A1%8C%E5%86%85%E5%AD%98%E6%BA%A2%E5%87%BA.png" alt="AndroidStudio&#x8FD0;&#x884C;&#x5185;&#x5B58;&#x6EA2;&#x51FA;"></p>
</li>
</ul>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>谢谢老板，请尽情用红包来蹂躏我吧！！！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wechatpay.jpg" alt="Tiimor 微信打赏">
        <p>微信打赏</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/alipay.jpg" alt="Tiimor 支付宝打赏">
        <p>支付宝打赏</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/Android/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>Android</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/AndroidStudio/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>AndroidStudio</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/gradle/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>gradle</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Windows上GitHub+Hexo搭建个人博客/" rel="next" title="Windows上GitHub+Hexo搭建个人博客">
                <i class="fa fa-chevron-left"></i> Windows上GitHub+Hexo搭建个人博客
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/那些年AndroidStudio上的开发插件神器/" rel="prev" title="那些年AndroidStudio上的开发插件神器">
                那些年AndroidStudio上的开发插件神器 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      
        <div id="gitment-container"></div>
      
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="Tiimor">
            
              <p class="site-author-name" itemprop="name">Tiimor</p>
              <p class="site-description motion-element" itemprop="description">安静地做一只攻城狮。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">41</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">56</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/VeiZhang" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.weibo.com/tiimor" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/589972d0570c3500624fd791" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-anchor"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.jianshu.com/u/93b886580243" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-book"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://wpa.qq.com/msgrd?v=3&uin=690393541&site=qq&menu=yes" target="_blank" title="QQ">
                      
                        <i class="fa fa-fw fa-qq"></i>QQ</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:tiimor@qq.com" target="_blank" title="邮箱">
                      
                        <i class="fa fa-fw fa-envelope"></i>邮箱</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#方法数超过64K"><span class="nav-number">1.</span> <span class="nav-text">方法数超过64K</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#包冲突"><span class="nav-number">2.</span> <span class="nav-text">包冲突</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#重复依赖"><span class="nav-number">3.</span> <span class="nav-text">重复依赖</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#依赖so异常"><span class="nav-number">4.</span> <span class="nav-text">依赖so异常</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#中文乱码"><span class="nav-number">5.</span> <span class="nav-text">中文乱码</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#找不到HttpClient方法"><span class="nav-number">6.</span> <span class="nav-text">找不到HttpClient方法</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Gradle编译禁用Lint报错"><span class="nav-number">7.</span> <span class="nav-text">Gradle编译禁用Lint报错</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#运行内存溢出"><span class="nav-number">8.</span> <span class="nav-text">运行内存溢出</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Tiimor</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a></div>




        
<div class="busuanzi-count">
  <!-- modify by zhangwei -->
  <!-- 修改不蒜子统计脚本 -->
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>



<script>
  	var _mtac = {};
  	(function() {
  		var mta = document.createElement("script");
  		mta.src = "https://pingjs.qq.com/h5/stats.js?v2.0.4";
  		mta.setAttribute("name", "MTAH5");
  		mta.setAttribute("sid", "500425805");

  		var s = document.getElementsByTagName("script")[0];
  		s.parentNode.insertBefore(mta, s);
  	})();
</script>


  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=61441764";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  







<!-- LOCAL: You can save these files to your site and update links -->
    
        
        <link rel="stylesheet" href="https://aimingoo.github.io/gitmint/style/default.css">
        <script src="https://aimingoo.github.io/gitmint/dist/gitmint.browser.js"></script>
    
<!-- END LOCAL -->

    

    
      <script type="text/javascript">
      function renderGitment(){
        var gitment = new Gitmint({
            <!-- modify by zhangwei -->
            <!-- 修复gitment评论页初始化错误@tiimor -->
            id: '1490964485000', 
            owner: 'VeiZhang',
            repo: 'veizhang.github.io',
            
            lang: "" || navigator.language || navigator.systemLanguage || navigator.userLanguage,
            
            oauth: {
            
            
                client_secret: '9919bc61413a89ea3eb156910d282e3103093e32',
            
                client_id: 'f08924ca58e61d6f51f4'
            }});
        gitment.render('gitment-container');
      }

      
      renderGitment();
      
      </script>
    







  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.4"></script>



  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("7aBs9I9Y3PjoN6ueX5J3AYQW-gzGzoHsz", "kboycyzaPNAYcUW8AkF3edeW");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

  
  <!-- modify by zhangwei -->
  <!-- 动态时间小人 -->
  <!-- modify by zhangwei -->
<!-- 动态时间小人 -->
<!-- z-index -1 表示在最底层，不能悬浮也不能点击 -->
<!-- z-index auto 可以点击 -->
<!-- z-index 9999 无限大时，总是在最上层，会影响其他悬浮框 -->
<div id="dg" style="z-index: auto; position: fixed ! important; right: 0px; top: 0px;">  
    <table width 100% style="position: absolute; width:260px; right: 0px; top: 0px;">  
		<div>
			<embed wmode="transparent" src="http://cdn.tiimor.cn/images/dynamic_time.swf" quality="high" bgcolor="#ffffff" width="160" height="70" name="honehoneclock" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
		</div>
    </table>  
</div>
  
</body>
</html>
